Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update file structure to match other sdks #51

Merged
merged 17 commits into from
May 6, 2024

Conversation

saschadoemer
Copy link
Member

No description provided.

The import statement in mqtt.py was updated to reference the correct file for SYNC and ASYNC constants. Additionally, the constants.py file was renamed to mqtt_connection_mode.py, providing a more accurate description of its content.
The certificate creation code has been encapsulated into a new class, CertificationService. This allows for a more organized codebase, increasing the readability and maintainability of the code. This change impacts the methods in the http.py and mqtt.py files where the create_certificate_file_from_pen function call is replaced by CertificationService.create_certificate_file_from_pen.
Moved `decode_response`, `read_properties_buffers_from_input_stream` methods into a new DecodingService class as static methods. Updated all their usages across the codebase to reflect this change. This consolidation streamlines code organization and enhances readability.
The decoding functions `decode_response` and `decode_details` have been refactored into static methods in the `DecodingService` class in `src/agrirouter/messaging/decode.py`. The changes also involved updating the relative imports in test files and other modules that were previously using these standalone functions.
The encoding functions previously contained within the file `encode.py` are refactored into a new class called `EncodingService`. This improves the organization of the code and makes it easier to manage and understand. All corresponding tests and imports have been updated to use this new class.
The standalone encode and write_proto_parts_to_buffer functions have been refactored into a static methods inside the newly created EncodingService class. All instances where these functions were called have been updated to use this new class method. This enhances the code structure and makes it more organized.
The enum classes, CertificateTypes and Gateways, previously located under onboarding.enums, have been moved to api.enums. The import statements in the impacted files have been adjusted accordingly. This ensures a more logical arrangement of the enum information and simplifies future maintenance.
The handling of signature creation and verification has been refactored into a new SignatureService class. This change has improved modularity and allowed signature-related functions to be called directly from the service. This commit involves changes to the agrirouter.onboarding, agrirouter.auth, and agrirouter.revoking modules, plus updates to relevant tests.
The utc_time_util functions have been adjusted into a class structure for improved organization and code readability. This also involves changes to the function calls in several source files where these functions were used.
The refactor includes changing the direct function calls of 'new_uuid()' to the class-based static method 'UUIDUtil.new_uuid()'. These changes impact multiple files across the application, improving the overall structure following the object-oriented programming paradigm.
The 'environments.py' file was renamed to 'env.py' and EnvironmentService class is now inside 'api/env.py'. References to the old file structure were updated accordingly across multiple modules to ensure correct importing. The 'environmental_services.py' was deleted after moving its content to 'env.py'.
This commit consolidates the handling of constants and keys within the agrirouter API. The 'mqtt_connection_mode.py' file has been deleted, and its ASYNC/SYNC constants moved into the '#constants.py' file. References to these keys and constants across the API have been updated to reflect the changes.
…components.

The package structure has been rearranged to improve code organization. The agrirouter 'onboarding' and 'messaging' modules were moved into a new 'service' module. As part of this reorganization, various code files were renamed and moved to new locations. This refactoring enhances the structure of the code and makes it easier to navigate and maintain. The naming and organization of components are now more logical, reflecting their associated responsibilities.
The protobuf file for agrirouter messaging, efdi_pb2.py, has been updated by removing unnecessary white spaces and a few unused import statements. File descriptor parameters have also been revised to enhance the efficiency and readability of the code.
The import statements in several modules have been refactored for better organization and clarity. Reorganization ensures relevant modules/classes are logically grouped together, improving code readability and maintainability.
Cleaned up the order of imports in various test modules. This process specifically prioritizes standard library imports, followed by related third party imports, and local application/library specific imports.
Made several changes in messaging services including restructuring and moving certain classes to align with design patterns. Also made minor changes and updates in file structures of various test scripts and source files. Improved unified decoding strategy with EncodingService class.
@oliverrahner oliverrahner merged commit 31695c0 into main May 6, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants